<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
		<meta charset="utf-8" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">我的毕业论文</a></li>
    <li><a href="#">我的毕业论文</a></li>
    </ul>
    </div>
    <div class="rightinfo">
     <c:if test="${add ==0 }">
     <div class="tools">
    
		<ul class="toolbar">
        <li class="click add"><span><img src="images/t01.png" /></span>上传</li>
        </ul>
    </div>
     </c:if>
     <table class="tablelist">
    	<thead>
    	<tr>
    	<th>学生姓名</th>
        <th>论文标题</th>
        <th>上传时间</th>
		<th>是否批阅</th>
       <th>操作</th>
       
      </tr>
        </thead>
        <tbody>
         <c:forEach items="${paperList}" var="paper"  varStatus="status">
      <tr>
       <td>${paper.studentName}</td>
        <td>${paper.thesisTitle}</td>
        <td>${paper.time}</td>
        <td><c:if test="${paper.whetherMarking==0}">未批阅</c:if><c:if test="${paper.whetherMarking==1}">已批阅</c:if></td>
		<td><c:if test="${paper.whetherMarking==0}"><a onclick="deleteThesis(${paper.studentNumber});">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="edit">编辑</a></c:if></td>
      </tr> 
      </c:forEach>
        </tbody>
    </table>
    </div>
	<script src="js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="js/ajaxfileupload.js"></script>
	<script type="text/javascript" src="js/jquery.tips.js"></script>
	<script src="layer/layer.js"></script>
	<script type="text/javascript">
	function closeAll() {
		layer.alert('上传成功!', {
			skin : 'layer-ext-moon'
		}, function() {
			layer.closeAll(); 
			 location.reload();
		}); 
	}
	function close() {
		layer.alert('修改成功!', {
			skin : 'layer-ext-moon'
		}, function() {
			layer.closeAll(); 
			 location.reload();
		}); 
	}
    $('.tablelist tbody tr:odd').addClass('odd');
	$(".add").click(
			function  () {
				layer.open({
		  type: 2,
		  closeBtn: 2,
		  title: '上传论文',
		  shadeClose: true,
		  shade: 0.6,
		  area: ['600px', '300px'],
		  content: 'thesis/thesis_add.do',
		  end: function () {
		      location.reload();
		  }
		 
		});
			}
			);
	function deleteThesis(studentNumber) {
		$.ajax({
			type: "GET",
			url: "thesis/delete.do?studentNumber="+studentNumber,
			async: true,
			dataType: "json",
			success: function(data) {
				if("success" == data.result){
					layer.alert('删除成功!', {
			            skin: 'layer-ext-moon' 
					}, function(){
					 location.reload();
					 });
					}else {
						layer.alert('删除失败!', {
				            skin: 'layer-ext-moon' 
				        });
						}
				}
			})
	};
	$(".edit").click(
	function  () {
		layer.open({
  type: 2,
  closeBtn: 2,
  title: '编辑论文',
  shadeClose: true,
  shade: 0.6,
  area: ['600px', '300px'],
  content: 'thesis/thesis_edit.do',
  end: function () {
      location.reload();
  }
		 
		});
			}
			);
	</script>
</body>

</html>
